/**
 * This script is very simple.  It is run in every frame. If a content-pane exists in that frame, it sends the
 * URL of that frame to background.html as well as the current scroll position.
 */
var pane = document.getElementById( "content-pane" );
if( !pane && document.getElementById( "viewport" ) ) pane = document.getElementById( "viewport" ).firstChild;
// Move everything into this block so that the objects don't even exist if it is not a PDF document
if( pane )
{
   
   var port    = chrome.extension.connect();
   var currLoc = window.location.href;
   var topU    = ( window.top )? window.top.location.href: currLoc;
   var sctop   = pane.scrollTop;
   var mess    = {href: currLoc, action:"send", scrollTop: sctop, topURL:topU};
   port.postMessage(mess);
}

